function setTeamMemberTransfer(data,layerIndex) {
    data = JSON.parse(data);
    let teamId = data.id;//得到小组id
    let result = myAjax("/user/user/getTeamUser", "get", {teamId: teamId});
    let teamMember = result.data.members;//得到未分组成员和该小组成员
    let teamMemberIds = [];
    $.each(teamMember, function (key, val) {
        teamMemberIds.push(val.id);//取得未分组成员和该小组成员的id值
    });
    //获取组内成员id数
    let rightIds = result.data.inTeamMemberIds;
    console.log("rightIds");
    console.log(rightIds);
    //获取未分组成员id
    let leftIds = teamMemberIds.filter(function (item) {
        return rightIds.indexOf(item) == -1;//等于未分组成员和该小组成员的id值去掉该小组成员id
    })
    let left = [];
    let right = [];
    console.log("leftIds");
    console.log(leftIds);
    layui.use('transfer', function () {
        var transfer = layui.transfer;
        transfer.render({
            elem: '#team_member',
            title: ["未分配组员", "该组内成员"],
            data: teamMember,
            parseData: function (res) {
                let title = "";
                if (res.name != null)
                    title = res.code + "(" + res.name + ")";
                else
                    title = res.code;
                return {
                    "value": res.id,
                    "title": title
                };
            },
            value: rightIds,
            showSearch: true,
            onchange: function (data, index) {
                console.log(data); //得到当前被穿梭的数据
                console.log(index); //如果数据来自左边，index 为 0，否则为 1
                let dataIds = [];
                //将移动的数据的id提取出来
                $.each(data, function (key, val) {
                    dataIds.push(val.value);
                });
                if (index == 0) {//如果数据来自左边，则将左边相同数据移除
                    left = left.filter(function (item) {
                        return dataIds.indexOf(item) == -1;
                    });
                    //将移除的数据加入右边
                    $.each(dataIds, function (key, val) {
                        right.push(val);
                    });
                    right = right.filter(function (item) {
                        return rightIds.indexOf(item) == -1;
                    });
                } else if (index == 1) {//如果数据来自右边，则将右边相同数据移除
                    right = right.filter(function (item) {
                        return dataIds.indexOf(item) == -1;
                    });
                    //将移动的数据加入到左边
                    $.each(dataIds, function (key, val) {
                        left.push(val);
                    });
                    left = left.filter(function (item) {
                        return leftIds.indexOf(item) == -1;
                    });
                }
                console.log("left");
                console.log(left);
                console.log("right");
                console.log(right);
                console.log("leftIds");
                console.log(leftIds);
                console.log("rightIds");
                console.log(rightIds);
            }
        });
        $("#save").click(function () {
            //获得右侧数据
            let datas = {
                "left": JSON.stringify(left),
                "right": JSON.stringify(right),
                "teamId": teamId
            }
            let result = myAjax("/team/userTeam/setUserTeam", "post", datas);
            if (result) {
                layer.alert(result.message, {icon: 1}, function () {
                    parent.location.reload();//刷新小组列表
                    parent.layer.close(layerIndex);
                });
            } else
                layer.alert(result.message);

        });
        $(("#cancel")).click(function () {
            parent.layer.close(layerIndex);
        });
    });
}
